"""
ihrm 登录接口对象层
"""
import requests

# 定义ihrm登录接口类
class IhrmLoginApi(object):
    # 定义方法
    @classmethod
    def login(cls,json_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/login",
                             headers={"Content-Type": "application/json"},
                             json=json_data)
        return resp

if __name__ == '__main__':
    # 准备测试数据
    json_data = {"mobile": "13800000002", "password": "888itcast.CN764%..."}
    result= IhrmLoginApi.login(json_data)
    print("登录成功:",result.json())